package hprose.hello.server;

import hprose.server.HproseHttpService;
import hprose.server.HttpContext;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

public class Hello {
	
    public String sayHello(String name) throws InterruptedException {
    	HttpContext context = HproseHttpService.getCurrentContext();
    	HttpSession session = context.getSession();
    	System.out.println(session.getId());
        return "Hello " + name + "!";
    }
    
    public Map sayHello2(Map<String, String> map) {
    	HttpContext context = HproseHttpService.getCurrentContext();
    	HttpSession session = context.getSession();
    	System.out.println(session.getId());
    	map.put("c", "c1");
        return map;
    }
    
    public Map sayHello3(Map<String, Object> map, int b) {
    	map.put("b", b);
        return map;
    }
    
    public List<Map<String, Object>> sayHello4(List<Map<String, Object>> list) {
    	Map<String, Object> map = new HashMap<String, Object>();
    	map.put("b", "b4");
    	list.add(map);
        return list;
    }
    
}
